package Semantics;

public class SemanticsOverload {
	public static int OVERLOAD_WITHINCLASS = 0;
	public static int OVERLOAD_SUPERCLASS = 1;
	
	public MethodSymbol[] methods;
	public int type;
	public SemanticsOverload(Object[] ms){
		type = OVERLOAD_WITHINCLASS;
		methods = new MethodSymbol[ms.length];
		
		for(int i = 0; i < ms.length; ++i){
			methods[i] = (MethodSymbol)ms[i];
		}
	}
	
	public SemanticsOverload(int t,Object[] ms){
		type = t;
		methods = new MethodSymbol[ms.length];
		
		for(int i = 0; i < ms.length; ++i){
			methods[i] = (MethodSymbol)ms[i];
		}
	}
	
	
	
	public void setMethods(Object[] ms){
		methods = new MethodSymbol[ms.length];
		
		for(int i = 0; i < ms.length; ++i){
			methods[i] = (MethodSymbol)ms[i];
		}
	}
	public String getMessage(){
		String message="";
		message+="duplicate methods :";
		for(int j = 0; j < this.methods.length; ++j){
	   		  message+="function " + methods[j].getId()+
	   		  			" at line " + methods[j].getLine()+" ";
   	  	}
		return message;
	}
	 
}
